package com.cnzha.mr.wordcount;

import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;

/**
 * @Author: zhaoxin
 * @email: zdkk@foxmail.com
 * @Date: 2020/4/4 16:14
 */
public class MyPartitoner extends Partitioner<Text, IntWritable> {
    @Override
    public int getPartition(Text text, IntWritable longWritable, int numPartitions) {
        boolean s = text.toString().startsWith("s");
        if (s) {
            return 1;
        }
        return 0;
    }
}
